<template>
  <div>
    <van-nav-bar
      title="设置"
      left-text="返回"
      left-arrow
      @click-left="onClickLeft"
    />
    <van-button  size="large" class="user" @click="goUserinfo">个人信息</van-button>
    <van-button  size="large" class="exit"  @click="logout">退出登录</van-button>
  </div>
</template>

<script>
export default {
  methods: {
    onClickLeft() {
      this.$router.back();
    },
    logout() {
      window.sessionStorage.clear()
      this.$router.push('/login')
    },
    goUserinfo(){
        this.$router.push('/userinfo')
    }
  },
};
</script>

<style lang="less" scoped>
.van-button{
    margin: 5px 0;
}
.user {
    background-color: #8f9399;
}
.exit{
    background-color: #ff9e68;
}
</style>